﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;

namespace DMZS.BLL
{
    /// <summary>
    /// 采购订单
    /// </summary>
    public class SalesOrder : DlyndxOrder
    {
        private readonly DMZS.DAL.SalesOrder dal = new DMZS.DAL.SalesOrder();

        public DMZS.Model.SalesOrder GetRecordByID(long ID)
        {
            return null;
        }

        /// <summary>
        /// 获取头部
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public System.Data.DataRow GetHead(long ID)
        {
            return dal.GetHead(ID);
        }
        /// <summary>
        /// 获取表体
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public System.Data.DataTable GetBody(long ID)
        {
            return dal.GetBody(ID);
        }
        /// <summary>
        /// 获取表体
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        public System.Data.DataTable GetBody(string Code)
        {
            return dal.GetBody(Code);
        }

        public long AddExpand(DMZS.Model.SalesOrder model)
        {
            return dal.AddExpand(model);
        }

        public long UpdateExpand(DMZS.Model.SalesOrder model)
        {
            return dal.UpdateExpand(model);
        }
        /// <summary>
        /// 删除一条记录
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public int DeleteExpand(long ID)
        {
            return dal.DeleteExpand(ID);
        }
        /// <summary>
        /// 审核
        /// -1000:被删除
        /// -10001:已审核
        /// -1003:已关闭
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="checke"></param>
        /// <returns></returns>
        public int Check(long ID, string checke)
        {
            return dal.Check(ID, checke);
        }
        /// <summary>
        /// 反审核
        /// -1000:被删除
        /// -10002:未审核
        /// -1003:已关闭
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public int UnCheck(long ID)
        {
            return dal.UnCheck(ID);
        }
        /// <summary>
        /// 关闭
        /// -1000:被删除
        /// -10002:未审核
        /// -1003:已关闭
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public int Close(long ID)
        {
            return dal.Close(ID);
        }

        /// <summary>
        /// 获取数据 对话框
        /// </summary>
        /// <param name="code"></param>
        /// <param name="status"></param>
        /// <param name="date"></param>
        public DataSet GetListForDialog(string code, int status, int date)
        {
            return dal.GetListForDialog(code, status, date);
        }
    }
}
